#ifndef __CAN_H
#define	__CAN_H

#include "stm32f10x.h"
#include <stdio.h>

#define CANx                      CAN1
#define CAN_CLK                   RCC_APB1Periph_CAN1

#define CAN_TX_GPIO_CLK           RCC_APB2Periph_GPIOA
#define CAN_TX_GPIO_PORT          GPIOA
#define CAN_TX_PIN                GPIO_Pin_12
#define CAN_RX_GPIO_CLK           RCC_APB2Periph_GPIOA
#define CAN_RX_GPIO_PORT          GPIOA
#define CAN_RX_PIN                GPIO_Pin_11

#define CAN_RX_IRQ								CAN1_RX1_IRQn
#define CAN_RX_IRQHandler					CAN1_RX1_IRQHandler

void CAN_Config(void);
void CAN_Transmit_Config(uint32_t ID, uint8_t Length, uint8_t *Data);
uint8_t CAN_ReceiverFlag_Config(void);
void CAN_Receive_Config(uint32_t *ID, uint8_t *Length, uint8_t *Data);

#endif /* __USART_H */
